<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE HTML>
<html>
<head>
<title>My JSP 'editAnswer.jsp' starting page</title>
<link href="img/ico.ico" rel="shortcut icon">

<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />

<script type="text/javascript" src="js/jquery-min.js"></script>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

</head>

<body>
	<%@ include file="pagetop/pagetitle.jsp"%>
<br/>
<c:if test="${not empty user }">
	<div style="padding-left: 15%;">
		<i class="icon-home"></i><a href="index.action">回主页 </a>
		
		
		&gt;&gt;&gt;&gt;&gt;
		&gt;&gt;&gt;&gt;&gt;
		
		<i class="icon-edit"></i><span>编辑问题</span>
		<hr />

		问题名称<span>${answers.question.questionname}</span><br />
		<form action="updateAnswer.action">



			修改答案：
			<textarea name="answers.content">${answers.content}</textarea>

			<br />
			答案状态： <input type="hidden" name="answers.id" value="${answers.id}" />
			<c:if test="${user.role=='clinical'||user.role=='admin'}">
				<input type="hidden" name="answers.lastexamine"
					value="${user.username}" />
				<select name="answers.state">
					<c:if test="${answers.state=='未审核'}">
						<option>${answers.state}</option>
						<option>审核中</option>
						<option>审核通过</option>
					</c:if>
					<c:if test="${answers.state=='审核中'}">
						<option>${answers.state}</option>
						<option>审核通过</option>
					</c:if>
					<c:if test="${answers.state=='审核通过'}">
						<option>${answers.state}</option>
					</c:if>
				</select>
			</c:if>
			<c:if test="${user.role=='sales'}">

				<select name="answers.state">
					<option>${answers.state}</option>
				</select>
			</c:if>
		</form>
		<input type="button" value="修改答案" />
	</div>
	</c:if>
</body>
<script type="text/javascript">
	$(function() {
		$("input[type='button']").click(function() {
			if ($("textarea").val().trim() == "") {
				alert("你还没输入任何东西！");
				return false;
			}
			$("form").submit();
		});
	});
</script>
</html>
